package Ch4;

/**
 * Created by Cai Ye on 2016/3/26.
 */

import static java.lang.System.out;

public class InterfaceGame {
    public static void main(String[] args) {
        play(InterfaceAction.RIGHT);
        play(InterfaceAction.UP);
    }

    public static void play(int action) {
        switch (action) {
            case InterfaceAction.STOP:
                out.println("播放停止动画");
                break;
            case InterfaceAction.RIGHT:
                out.println("播放向右动画");
                break;
            case InterfaceAction.LEFT:
                out.println("播放向左动画");
                break;
            case InterfaceAction.UP:
                out.println("播放向上动画");
                break;
            case InterfaceAction.DOWN:
                out.println("播放向下动画");
                break;
            default:
                out.println("不支持此动作");
        }
    }
}
